package com.javabi.htmlbuilder.css.declaration;

import com.javabi.htmlbuilder.css.CSSBuilder;
import com.javabi.htmlbuilder.css.CSSDeclaration;
import com.javabi.htmlbuilder.css.CSSPropertyName;

/**
 * A CSS Clear.
 */
public enum Clear implements CSSDeclaration {

	/** The left. */
	LEFT("left"),
	/** The right. */
	RIGHT("right"),
	/** The both. */
	BOTH("both"),
	/** The none. */
	NONE("none");

	/** The value. */
	private final String value;

	/**
	 * Creates a new declaration.
	 * @param value the value.
	 */
	private Clear(String value) {
		this.value = value;
	}

	/**
	 * Returns the value.
	 * @return the value.
	 */
	public String getValue() {
		return value;
	}

	/**
	 * Returns the property.
	 * @return the property.
	 */
	public CSSPropertyName getPropertyName() {
		return CSSPropertyName.CLEAR;
	}

	/**
	 * Append this to the given css builder.
	 * @param css the css builder.
	 * @return the css builder.
	 */
	public CSSBuilder appendTo(CSSBuilder css) {
		return css.property(getPropertyName(), getValue());
	}

}
